package top.toptimus.dto.measure;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Comparator;
import java.util.List;

/**
 * 尺寸表中全部量体值项目
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MeasureItemFacadeDTO {
    private String sessionId;
    private List<MeasureItemDTO> measureItemDTOS;

    /**
     * 按照index排序
     *
     * @return this
     */
    public MeasureItemFacadeDTO SortByIndex() {
        this.measureItemDTOS.sort(Comparator.comparing(MeasureItemDTO::getIndex));
        return this;
    }
}
